package com.example.springbootdemo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.StringHttpMessageConverter;

import java.nio.charset.Charset;

//声明这是一个引导类   程序的入口
@SpringBootApplication
@Configuration

public class SpringbootdemoApplication {

    //配置消息转换器  这是为了后期配置json转换的
	@Bean
	public StringHttpMessageConverter stringHttpMessageConverter(){
		StringHttpMessageConverter converter  = new StringHttpMessageConverter(Charset.forName("UTF-8"));
		return converter;
	}

	public static void main(String[] args) {
		//启动容器
		SpringApplication.run(SpringbootdemoApplication.class, args);
	}
}
